package com.dragon.modules.yuegou.model.rbac;


import com.dragon.modules.yuegou.web.Tree;

public class RbacAppResource {

	private final RbacApp app;

	private final RbacResourceNode tree;

	public RbacAppResource(RbacApp app, Tree<RbacResourceNode> tree) {
		super();
		this.app = app;
		this.tree = tree.isEmpty() ? null : tree.root().element();
	}

	public RbacAppResource(RbacApp app, RbacResourceNode tree) {
		super();
		this.app = app;
		this.tree = tree;
	}

	public RbacApp getApp() {
		return app;
	}

	public RbacResourceNode getTree() {
		return tree;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("RbacAppResource [app=");
		builder.append(app);
		builder.append(", tree=");
		builder.append(tree);
		builder.append("]");
		return builder.toString();
	}

}
